.PHONY: all clean compile sim sim_gui

all: compile

clean:
	rm -fr work
	rm -f transcript
	rm -f *.wlf
	rm -f modelsim.ini
	rm -f testgen.o
	rm -f testgen

compile:
	@vsim -c -do "do scripts/compile.do;quit -f"

sim:
	@vsim -c -t ps work.tb -quiet -do "run -all;quit -f" | grep -E "\*\*|Errors"

sim_gui:
	@vsim -t ps work.tb -quiet -do "do scripts/wave.do;run -all;wave zoom full"

testgen:
	gcc -Wall -Wextra -std=c99 -pedantic -c ./testdata/testgen.c
	gcc -Wall -Wextra -std=c99 -pedantic -g testgen.o -o testgen
	./testgen

.PHONY: testgen

